clear all;
clc;

% subdural
isens_exp_sub=[0.20,0.35,0.20,0.55,0.80];
ipain_exp_sub=[0.50,0.50,0.80,1.20,3.10];
% extradural
isens_exp_epi=[1.30,19.0,7.00,3.00,9.00];
ipain_exp_epi=[2.20,24.5,19.0,6.00,19.0];   


%% figures


return

%% statistics

[h_sub_sensvspain,p1]=kstest2(isens_exp_sub,ipain_exp_sub)
[h_sens_subvsepi,p2]=kstest2(isens_exp_sub,isens_exp_epi)
[h_epi_sensvspain,p3]=kstest2(isens_exp_epi,ipain_exp_epi)
[h_pain_subvsepi,p4]=kstest2(ipain_exp_sub,ipain_exp_epi)


%% -------------------- Correlation w/ Spinal Geometry

spcord_delx=[7,8,8,9,8];
spcord_dely=[6,7,6,6,6];
csf_delx=[19,21,20,18,18];
csf_dely=[16,18,14,13,15];
spcord_loc=(1-[1/2,1/3,1/2,1/2,1/3]).*(csf_delx+csf_dely)*(1/2);

% spinal cord delta x
display('spinal cord, delta x');
[r2,pv]=calc_r2(spcord_delx,isens_exp_sub)
[r2,pv]=calc_r2(spcord_delx,isens_exp_epi)
[r2,pv]=calc_r2(spcord_delx,ipain_exp_sub)
[r2,pv]=calc_r2(spcord_delx,ipain_exp_epi)

% spinal cord delta y
display('spinal cord, delta y');
[r2,pv]=calc_r2(spcord_dely,isens_exp_sub)
[r2,pv]=calc_r2(spcord_dely,isens_exp_epi)
[r2,pv]=calc_r2(spcord_dely,ipain_exp_sub)
[r2,pv]=calc_r2(spcord_dely,ipain_exp_epi)

% CSF delta x
display('CSF, delta x');
[r2,pv]=calc_r2(csf_delx,isens_exp_sub)
[r2,pv]=calc_r2(csf_delx,isens_exp_epi)
[r2,pv]=calc_r2(csf_delx,ipain_exp_sub)
[r2,pv]=calc_r2(csf_delx,ipain_exp_epi)

% spinal cord delta x
display('CSF, delta y');
[r2,pv]=calc_r2(csf_dely,isens_exp_sub)
[r2,pv]=calc_r2(csf_dely,isens_exp_epi)
[r2,pv]=calc_r2(csf_dely,ipain_exp_sub)
[r2,pv]=calc_r2(csf_dely,ipain_exp_epi)

% spinal cord location
display('spinal cord location');
[r2,pv]=calc_r2(spcord_loc,isens_exp_sub)
[r2,pv]=calc_r2(spcord_loc,isens_exp_epi)
[r2,pv]=calc_r2(spcord_loc,ipain_exp_sub)
[r2,pv]=calc_r2(spcord_loc,ipain_exp_epi)

% figure;
% plot(spcord_dely,isens_exp_epi,'k.');
% figure;
% plot(spcord_loc,isens_exp_epi,'k.');
